package com.lz.ub

import com.lz.ub.core.UBCScanResult

/**
 * @author You
 * 主板事件回调
 */
interface UBCEventCallback {

    //设备启动
    fun onRestart()

    //ok事件
    fun onOK()

    //设备连上, 还需要设置UUID
    fun onConnected(mac: String, id: Int)

    //返回UUID成功时的回调
    fun onSuccess()

    //设置UUID服务
    fun onService()

    //断开
    fun onDisconnected(mac: String)

    //写入
    fun onWrite(size: Int)

    //读取
    fun onReceived(id: Int, data: String)

    //读取16进制数据
    fun onReceivedHex(id: Int, bytes: ByteArray, start: Int, size: Int)

    //扫描结果
    fun onScan(result: UBCScanResult)

    //异常
    fun onError()
}